home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / asm32.zip / SYSTEM.DOC < prev    next >
Text File  |  1995-11-30  |  20KB  |  728 lines

  1.  
  2. *****************************  SYSTEM  *************************************
  3.  
  4. ASM32 system subroutines Copyright (C) 1993 - 1995 Douglas Herr
  5. all rights reserved
  6.  
  7.  
  8. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  9.  
  10. COLOR16:     calculate color value for palette register
  11. Source:      color16.asm
  12.  
  13. Call with:   EBX pointing to red value (0-3), green value (0-3)
  14.              and blue value (0-3); see also Palette16
  15. Returns:     AH = color value for 16-color palette register
  16. Uses:        AH
  17. Supports:    VGA 16-color modes (text or graphics)
  18.              EGA 16-color modes, except with CGA monitor
  19. Example:
  20.  
  21. extrn   color16:near
  22.  
  23. include dataseg.inc
  24.  
  25. c16     db 3                  ; brightest red
  26.         db 1                  ; dim green
  27.         db 0                  ; no blue
  28.  
  29. @curseg ends
  30.  
  31. include codeseg.inc
  32.         .
  33.         .
  34.         .
  35.         lea   ebx,c16
  36.         call  color16
  37.  
  38.  
  39.  
  40. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  41.  
  42. EXENAME:     determine the full path and filename of the executing program
  43. Source:      exename.asm (strlen.asm)
  44.  
  45. Call with:   no parameters
  46. Returns:     ECX = length of program name string
  47. (CauseWay FLAT model)
  48.              [EBX] = near pointer to the name of the executing program,
  49.              including drive and full path.
  50.  
  51. (all except CauseWay FLAT model)
  52.              ES:[EBX] = far pointer to the the name of the executing program,
  53.              including drive and full path.
  54.  
  55.              The filename returned is an ASCIIZ string in the program's
  56.              environment segment.
  57.  
  58. (all except CauseWay FLAT model)
  59.              Version 2.0: Note that EXENAME does not copy the program name to
  60.              near data.  It returns a far pointer to the program name which
  61.              you may copy to near data with STRNDUP if you wish.
  62.  
  63. Uses:        ES (except CW FLAT model), EBX, ECX, flags
  64. Example:
  65.  
  66. extrn   exename:near
  67.  
  68. include codeseg.inc
  69.  
  70.         .
  71.         .
  72.         .
  73.         call    exename         ; string returned at ES:[EBX]
  74. IFNDEF  FLATMODEL
  75.         call    strndup         ; copy to near data area
  76. ENDIF
  77.       
  78.  
  79.  
  80.  
  81. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  82.  
  83. EXESIZE:     determine size of .EXE program
  84. Source:      exesize.asm
  85.  
  86. Call with:   [EDX] pointing to ASCIIZ .EXE filename
  87. Returns:     if CF = 1, AX = DOS error code
  88.                         if AX = 0, not an EXE-format file
  89.              if CF = 0, EAX = bytes in .EXE file loaded by DOS program
  90.                         loader and by CauseWay
  91.              Note that additional data may be copied to the end of a DOS
  92.              .EXE file with the DOS COPY /B command.  This is handy for
  93.              help screens or other such data that you want to keep with
  94.              the .EXE file, but that you don't want to be loaded in memory
  95.              with the program.  If you do copy additional data to the .EXE
  96.              file, EXESize will report only the portion of the file loaded
  97.              in RAM by the DOS program loader and CauseWay, while FSize (in
  98.              DISK.DOC) reports the entire file size.
  99. Uses:        EAX, flags
  100. Example:
  101.  
  102. ;
  103. ; code used to test EXEsize
  104. ;
  105. include model.inc
  106.  
  107. public  testcode
  108. extrn   exename:near, exesize:near
  109. extrn   strndup:near, i4tostr:near
  110. extrn   tprint:near, getkey:near
  111.  
  112. include dataseg.inc
  113. extrn   pspseg:word
  114. space   db 20 dup(0)
  115. @curseg ends
  116.  
  117. include codeseg.inc
  118. testcode        proc near
  119.         mov     es,pspseg
  120.         call    exename         ; get name of this program
  121.         call    strndup         ; copy to near heap
  122.                                 ; startup code was assembled with /DHEAP
  123.         mov     edx,ebx         ; [EDX] -> EXE filename
  124.         call    exesize         ; EAX = EXE program size
  125.         lea     esi,space
  126.         call    i4tostr         ; convert to ASCIIZ string
  127.         xor     edx,edx         ; point to UL corner of screen
  128.         mov     ah,12           ; "can't miss it" color
  129.         call    tprint          ; print it
  130.         call    getkey          ; don't scroll off screen yet
  131.         ret                     ; go back to calling code
  132. testcode        endp
  133.  
  134. @curseg ends
  135.         end
  136.  
  137.  
  138. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  139.  
  140. FLOPPIES:    determine the number of floppy disk drives intalled
  141. Source:      floppies.asm
  142.  
  143. Call with:   no parameters
  144. Returns:     AX = number of floppy drives
  145. Uses:        AX; all other registers and flags are saved
  146. Example:
  147.  
  148. include model.inc
  149.  
  150. extrn   floppies:near
  151.  
  152. include codeseg.inc
  153.  
  154. myproc  proc   near
  155.         .
  156.         call   floppies
  157.  
  158.  
  159.  
  160. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  161.  
  162. FLOPPYTYPE:  determine the type of floppy disk drives intalled
  163. Source:      floptype.asm
  164.  
  165. Call with:   DL = drive number (0 = drive A:)
  166. Returns:     AX = floppy drive type
  167.               0 = invalid drive number
  168.               1 = 360k
  169.               2 = 1.2M
  170.               3 = 720k
  171.               4 = 1.44M
  172. Uses:        AX, flags
  173. Example:
  174.  
  175. include model.inc
  176.  
  177. public  myproc
  178. extrn   floppytype:near
  179.  
  180. .data
  181. drive_number   db 0
  182.  
  183. .code
  184. myproc  proc
  185.         .
  186.         mov    dl,drive_number
  187.         call   floppytype
  188.         or     ax,ax
  189.         jz     bad_drive_number
  190.  
  191. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  192.  
  193. GETCPU:      detects cpu type
  194. Source:      getcpu.asm
  195.  
  196. Call with:   no parameters
  197. Returns:     AX = 3 if 386 (SX or DX)
  198.              AX = 4 if 486 (SX or DX)
  199. Uses:        AX
  200. Example:     call   getcpu
  201.  
  202.  
  203.  
  204. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  205.  
  206. GETCRT:      determines active monitor type
  207. Source:      getcrt.asm ($herc.asm, isevga.asm)
  208.  
  209. Call with:   no parameters
  210. Returns:     AX = code for active video system
  211.              CGA = -1
  212.              MDA = 0
  213.              EGA mono = 0100h
  214.              VGA mono = 0300h
  215.              EGA color = 1
  216.              MCGA = 2
  217.              VGA color = 3
  218.              HGC = 128
  219.              HGC+ = 144
  220.              InColor = 208
  221.              Note: GetCRT may be re-assembled with the /DNOHERC switch
  222.              to eliminate code which detects Hercules equipment
  223. Uses:        AX
  224. Supports:    CGA, MCGA, MDA, HGC, HGC+, InColor, EGA, VGA
  225. Example:     call    getcrt
  226.  
  227.  
  228.  
  229. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  230.  
  231. INSERT:      control INSERT key status
  232. Source:      insert.asm (cw$info.asm)
  233.  
  234. Call with:   AL = 0 to turn INSERT off in BIOS data area
  235.              AL = 1 to turn INSERT on in BIOS data area
  236. Returns:     nothing
  237. Uses:        nothing
  238. Example:
  239.  
  240. include codeseg.inc
  241.  
  242. extrn   insert:near
  243.  
  244. ; code
  245.  
  246.         mov     al,1         ; turn INSERT on in BIOS data area
  247.         call    insert
  248.  
  249.  
  250.  
  251. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  252.  
  253. ISANSI:      determines if ANSI or compatible is loaded and active
  254. Source:      isansi.asm
  255.  
  256. Call with:   no parameters
  257. Returns:     CF = 1 if no ANSI device driver loaded and active
  258.              CF = 0 if ANSI loaded and active
  259. Uses:        CF
  260. Example:
  261.  
  262. include codeseg.inc
  263.  
  264. extrn   isansi:near
  265.  
  266. ; code
  267.         .
  268.         .
  269.         .
  270.         call   isansi         ; let's see if ansi.sys is loaded
  271.         jc     no_ansi        ; jump if not
  272.  
  273.  
  274.  
  275. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  276.  
  277. ISATT:       determines if an ATT 6300-type display card is installed
  278.              This equipment is like a CGA except that it has an additional
  279.              640 x 400 2-color graphics mode (mode 40h)
  280. Source:      isatt.asm ($6845.asm, isevga.asm)
  281.  
  282. Call with:   no parameters
  283. Returns:     if CF = 1, ATT 6300 display not present
  284.              if CF = 0, ATT 6300 display is installed
  285. Uses:        flags
  286. Example:
  287.  
  288. public  cgamode
  289.  
  290. extrn   isatt:near
  291.  
  292. include codeseg.inc
  293.  
  294. cgamode proc    near
  295.         mov     ax,06h             ; default: set CGA mode
  296.         call    isatt              ; see if mode 40h is available
  297.         jc      short set_mode     ;  nope
  298.         mov     ax,40h             ; use ATT 6300 mode 40h
  299. set_mode:
  300.         int     10h                ; use BIOS to set mode
  301.         ret
  302.  
  303. cgamode endp
  304.  
  305. @curseg ends
  306.         end
  307.  
  308.  
  309. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  310.  
  311. ISEVGA:      determines if an EGA or VGA is installed
  312. Source:      isevga.asm
  313.  
  314. Call with:   no parameters
  315. Returns:     if CF = 1, no EGA or VGA
  316.              if CF = 0
  317.                DX = video memory in kbytes
  318.                AL = monitor type
  319.                 AL = -1 if monitor is CGA
  320.                 AL = 0 if monitor is monochrome
  321.                 AL = 1 if monitor is EGA or better
  322.  
  323.                AH = EGA/VGA flag
  324.                 AH = 1 if EGA
  325.                 AH = 3 if VGA
  326.  
  327. Uses:        AX, DX, CF
  328. Example:
  329.  
  330. include codeseg.inc
  331.  
  332. extrn   isevga:near
  333.  
  334. ; code
  335.         .
  336.         .
  337.         .
  338.         call   isevga
  339.         jc     no_evga
  340.  
  341.  
  342.  
  343. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  344.  
  345. ISHERC:      determines if a Hercules card or compatible is installed
  346.              and if so, determines if it is the active video system.
  347. Source:      isherc.asm ($herc.asm)
  348.  
  349. Call with:   no parameters
  350. Returns:     if CF = 1, no Hercules or compatible installed
  351.              if CF = 0, AX = Hercules model
  352.              128 = Hercules Graphics Card or compatible; active
  353.              144 = Hercules Graphics Card Plus; active
  354.              208 = Hercules InColor card; active
  355.              -128 = Hercules Graphics Card or compatible; not active
  356.              -144 = Hercules Graphics Card Plus; not active
  357.              -208 = Hercules InColor card; not active
  358. Uses:        AX, CF; all other flags and registers are saved
  359. Example:
  360.  
  361. include codeseg.inc
  362.  
  363. extrn   isherc:near
  364.  
  365. ; code
  366.         .
  367.         .
  368.         .
  369.         call  isherc
  370.         jc    no_herc
  371.  
  372.  
  373. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  374.  
  375. ISMONO:      detects a monochrome-compatible video card
  376.              this is handy in 2-monitor systems.
  377. Source:      $6845.asm
  378.  
  379. Call with:   no parameters
  380. Returns:     if CF = 1, no monochrome monitor
  381.              if CF = 0, monochrome monitor is installed
  382.                         including Hercules InColor
  383. Uses:        flags
  384. Supports:    MDA, EGA & VGA MONO, HGC, HGC+, InColor
  385. Example:
  386.  
  387. include codeseg.inc
  388.  
  389. extrn   ismono:near
  390.  
  391. ; code
  392.         .
  393.         .
  394.         .
  395.         call  ismono
  396.         jc    no_monochrome
  397.  
  398.  
  399.  
  400. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  401.  
  402. ISMOUSE:     determines if a mouse is installed
  403. Source:      ismouse.asm
  404.  
  405. Call with:   no parameters
  406. Returns:     if CF = 0, AX = number of mouse buttons
  407.              if CF = 1, no mouse or mouse driver not installed
  408. Uses:        AX, flags
  409. Example:
  410.  
  411. include  codeseg.inc
  412.  
  413. extrn    ismouse:near
  414.  
  415. ; code
  416.         .
  417.         .
  418.         .
  419.         call    ismouse
  420.         jc      no_mouse
  421.  
  422.  
  423.  
  424. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  425.  
  426. ISSEVGA:     determines if a Super EGA or Super VGA is installed
  427. Source:      issevga.asm
  428.  
  429. Call with:   no parameters
  430. Returns:     if CF = 1, no Super EGA or Super VGA recognized by ASM32
  431.  
  432.              if CF = 0
  433.  
  434.               if AH = 1: (Super EGA)
  435.                AL = 1 if Paradise EGA 480
  436.                AL = 2 if Everex EGA
  437.  
  438.               if AH = 3: (Super VGA)
  439.                AL = 1 if Paradise VGA
  440.                AL = 3 if Tseng VGA chipset
  441.                AL = 4 if Oak VGA
  442.                AL = 5 if Western Digital VGA chipset
  443.  
  444.              See also IsEVGA and WhichVGA
  445. Uses:        AX, CF
  446. Example:
  447.  
  448. include codeseg.inc
  449.  
  450. extrn   issevga:near
  451.  
  452. ; code
  453.         .
  454.         .
  455.         .
  456.         call   issevga
  457.         jc     no_superevga
  458.  
  459.  
  460.  
  461. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  462.  
  463. ISVBE:       determines if VESA Video BIOS Extension (VBE) is installed
  464. Source:      isvbe.asm
  465.  
  466. Call with:   no parameters
  467. Returns:     if CF = 1, no VBE video card installed
  468.              if CF = 0, EBX = near pointer to VESA info data structure
  469.  
  470.              The VESA information data structure in IsVBE is similar to
  471.              the information structure returned by VESA function AX = 4F00h
  472.              except that IsVBE copies the data to 32-bit memory and converts
  473.              the OEMSTR and VIDEOMODEPTR pointers from real-mode addresses to
  474.              32-bit linear addresses.  See VESA VBE documentation for
  475.              description of VGAInfoBlock fields.
  476.  
  477. Uses:        EBX, CF
  478. Supports:    VBE versions 1.x and 2.x
  479. Known bugs:  Trident 9400CXi BIOS may return incorrect TotalMemory field.
  480. Example:
  481.  
  482. ; I want to use VESA mode 110h, a 640x480, 32k-color mode
  483. ; check for VBE, then check the VideoModePtr for 0110h
  484.  
  485. include model.inc
  486.  
  487. extrn   isvbe:near
  488.  
  489. VGAInfoBlock    struc
  490. signature       db 'VESA'
  491. vbever          dw ?
  492. oemstr          dd ?
  493. capabilities    db 4 dup(?)
  494. VideoModePtr    dd ?
  495. TotalMemory     dw ?
  496. Reserved        db 236 dup(?)
  497. pad             db 256 dup(?)
  498. VGAInfoBlock    ends
  499.  
  500. include dataseg.inc
  501.  
  502. ; external data in STARTxx.ASM
  503. extrn   zero_sel:dword         ; selector for linear memory address
  504.                                ; tell the assmebler it's a DWORD so it
  505.                                ; won't add a superfluous 66h byte prefix.
  506. @curseg ends
  507.  
  508. ; (continued on next page)
  509.  
  510. ; IsVBE example, continued)
  511.  
  512. include codeseg.inc
  513.         .
  514.         .
  515.         .
  516.         call    isvbe
  517.         jc      short cant_use_0110h
  518.  
  519. ;
  520. ; get linear address of list of supported modes
  521. ;
  522.         mov     edi,[ebx].VideoModePtr
  523.         mov     ax,0110h
  524.         mov     es,zero_sel             ; ES:[EDI] -> list of supported modes
  525.         cld
  526. ck_list_end:
  527.         cmp     word ptr es:[edi],0FFh  ; end of mode list?
  528.         je      short cant_use_0110h
  529.         scasw                           ; mode supported?
  530.         jne     short ck_list_end       ;  not found yet
  531.  
  532. ;
  533. ; mode 0110h is supported
  534. ; do what you want with it
  535. ;
  536.         .
  537.         .
  538.  
  539.  
  540.  
  541. ;
  542. ; general failure
  543. ;
  544. cant_use_0110h:
  545.         .
  546.         .
  547.         .
  548.  
  549.  
  550. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  551.  
  552. KBDTYPE:     determines type of keyboard and functions supported
  553. Source:      kbdtype.asm
  554.  
  555. Call with:   no parameters
  556. Returns:     if AH = 10h, advanced keyboard functions supported
  557.                   AL = 0 if 84-key keyboard
  558.                   AL = 1 if 101-key keyboard
  559.  
  560.              if AH = 0, advanced keyboard functions not supported
  561.                   AL = 0
  562.  
  563.              if advanced keyboard functions are not supported, it is
  564.              likely the program is running on an old XT-type computer
  565.              converted to 386 with the Intel InBoard 386/PC board.  You
  566.              will not encounter this equipment often.
  567.  
  568. Uses:        AX, flags
  569. Example:
  570.  
  571. ; Use KBDTYPE to determine which function to use to read a keystroke
  572.  
  573. extrn   kbdtype:near
  574.  
  575.         .
  576.         .
  577.         .
  578.         call    kbdtype            ; get appropriate BIOS function number
  579.         int     16h                ; get key from keyboard buffer
  580.  
  581.  
  582. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  583.  
  584. MATHCHIP:    determines if x87 math coprocessor is installed
  585. Source:      mathchip.asm
  586.  
  587. Call with:   no parameters
  588. Returns:     AX = code for x87 model
  589.              0 = not installed
  590.              2 = 287                   ; earliest 386 computers used 287
  591.              3 = 387 (DX or SX)
  592.              4 = 487 (DX or SX)
  593.              If the coprocessor is present, it is initilaized by MathChip.
  594. Uses:        AX, all x87 registers
  595. Example:     call  mathchip
  596.  
  597.  
  598.  
  599.  
  600. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  601.  
  602. MOUSESAVE:   save mouse state
  603. Source:      moussave.asm
  604.  
  605. MOUSERESTORE:restore previously saved mouse state
  606. Source:      moussave.asm
  607.  
  608.              MouseSave and MouseRestore are handy when you have installed a
  609.              mouse event handler and you will be using the SYSTEM command,
  610.              where some other program may reset or otherwise change the
  611.              mouse event trapping.
  612.  
  613.              MouseSave allocates a buffer, saves the mouse state in the
  614.              buffer, resets the mouse driver and returns the buffer address.
  615.  
  616.              MouseRestore restores a specified mouse state and releases the
  617.              buffer.  Both MouseSave and MouseRestore assume that you already
  618.              know there is a mouse in the system.
  619.  
  620. Call with:   MouseSave: no paramerters
  621.              MouseRestore: AX = buffer address returned by MouseSave
  622. Returns:     if CF = 1, AH = DOS error code
  623.              if CF = 0, no error; MouseSave returns buffer address in AX
  624. Uses:        AX, flags
  625. Example:
  626.  
  627. include model.inc
  628. extrn   msave:near, mrestore:near
  629.  
  630. include dataseg.inc
  631. save_mouse dw 0
  632. @curseg    ends
  633.  
  634. include codeseg.inc
  635.  
  636.         .
  637.         .
  638.         .
  639.  
  640. ; save the mouse driver state
  641. ; I've already checked to see if there's a mouse
  642.         call    mousesave
  643.         jc      dos_error
  644.         mov     save_mouse,ax
  645.         .
  646.         .
  647. ; some other subroutine has messed with the mouse
  648.         mov     ax,save_mouse   ; buffer address from previous MSave
  649.         call    mouserestore
  650.         jc      dos_error
  651.  
  652.  
  653.  
  654. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  655.  
  656. PALETTE16:   change palette in EGA, VGA or SVGA 16-color mode
  657.              changing the palette changes the actual color associated
  658.              with a color attribute
  659. Source:      palet16.asm
  660.  
  661. Call with:   BH = color value (see Color16 in SYSTEM.DOC)
  662.              BL = color attribute to map color to (0-0Fh)
  663.              restore default palette with BX = 0FFFFh
  664. Returns:     nothing
  665. Uses:        nothing
  666. Supports:    EGA, VGA, SVGA 16-color modes, text or graphics
  667.              except EGA with CGA monitor
  668. Example:
  669.  
  670. include codeseg.inc
  671.  
  672. extrn   color16:near, palette16:near
  673.  
  674. ; data
  675. c16     db 3                  ; brightest red
  676.         db 1                  ; dim green
  677.         db 0                  ; no blue
  678.  
  679. ; code
  680.         .
  681.         .
  682.         .
  683.         lea   ebx,c16
  684.         call  color16
  685.         mov   bh,ah           ; color value in BH
  686.         mov   bl,15           ; color attribute 0Fh
  687.         call  palette16
  688.  
  689.  
  690.  
  691. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  692.  
  693. USE32K:      limit Hercules equipment to 32k memory (128k on InColor)
  694. USE64K:      allow full 64k on HGC and HGC+ (256k on InColor)
  695. Source:      $herc.asm
  696.  
  697. Requires Hercules or compatible
  698.  
  699. Call with:   no parameters
  700.              Use32k is equivalent to the Hercules "half" configuration
  701.              Use64k is equivalent to the Hercules "full" configuration
  702.              ASM32's default is "half".  Use this configuration if you
  703.              have a 2-monitor system, unless you are using the Hercules
  704.              CGA card. 
  705. Returns:     nothing
  706. Uses:        nothing
  707. Example:     ; in this example I'm determining if a Hercules is installed
  708.              ; and setting the configuration to "full"
  709.  
  710.  
  711. extrn   IsHerc:near
  712. extrn   Use64k:near
  713.  
  714. include codeseg.inc
  715.  
  716.         .
  717.         .
  718.         .
  719.         call  IsHerc
  720.         jc    no_herc
  721.         or    ax,ax
  722.  
  723. ; use_only_half if HGC is not default monitor
  724.         js    short use_only_half
  725.         call  use64k          ; else use all Hercules memory
  726. use_only_half:
  727.  
  728.